package design_patterns.tx;

public class SXB implements Runnable
{
    @Override
    public void run() {
        synchronized (SXB.class){
            System.out.println("B在获取锁");
            synchronized (SXA.class){
                System.out.println("A在获取锁");
            }
        }
    }

    public static void main(String[] args) {
        new Thread(new SXA()).start();
        new Thread(new SXB()).start();
    }
}
